﻿using Jurassic;
using NUnit.Framework;

namespace Kiwi.Node.Tests
{
    [TestFixture]
    public class Scratch
    {
        [Test]
        public void Test()
        {
            var app = new Application();

            var module = app.CreateModule(
                new StringScriptSource(@"
var test_module = function(name){
    return;
    console.log('require(\'%s\') is', name, require(name));
    console.log('require.resolve(\'%s\') is', name, require.resolve(name));
    console.log('');
};
test_module('events');
test_module('util');
test_module('scripts/module_with_exports');
test_module('scripts/module_with_define');
test_module('scripts/missing');


console.log('fetching http');
var http = require('http');

http.on('test',function (a,b,c) { console.log('test called', a,b,c); });

http.emit('test',1234,'hej hopp');

http.emit('test','second time');


"));
        }
    }
}
